#include <iostream>
#include <cstdio>
#include <algorithm>
typedef long long ll;
const int N = 1e5 + 5;
int n;
struct Sum
{
    int ans;
    int id;

    const bool operator<(const Sum &rhs) const
    {
        return ans < rhs.ans || (ans == rhs.ans && id < rhs.id);
    }
};
int w[N];
Sum sum[N];
int main()
{
    int m;
    std::cin >> n >> m;

    for (int i = 1; i <= n; i++)
    {
        scanf("%d", &w[i]);
    }
    for (int i = 1; i <= n; i++)
    {
        sum[i].ans = sum[i - 1].ans + w[i];
        sum[i].id = i;
    }
    sum[n + 1].ans = sum[n + 1].id = 0;
    std::sort(sum + 1, sum + 2 + n);
    sum[0].ans = sum[0].id = 0xc0c0c0c0;
    while (m--)
    {
        int k;
        scanf("%d", &k);

        int l = 0;
        int r = n + 1;

        while (l < r)
        {
            int mid = (l + r + 1) >> 1;
            if (sum[mid].ans <= k)
            {
                l = mid;
            }
            else
            {
                r = mid - 1;
            }
        }

        if (l == 0)
        {
            puts("-1");
        }
        else
        {
            printf("%d\n", sum[l].id);
        }
    }
    return 0;
}